package frame.networks;

import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.JSplitPane;

import frame.SimulatorFrame;
import frame.networks.tables.NetworksTableTabbedPane;
import frame.networks.viewers.SdnVisualizationViewersTabbedPane;
import frame.networks.viewers.VirtualVisualizationViewersTabbedPane;

@SuppressWarnings("serial")
public class NetworksPanel extends JPanel
{
	private NetworksTableTabbedPane networksTableTabbedPane;
	public NetworksTableTabbedPane getNetworksTablesTabbedPane(){ return networksTableTabbedPane; }
	public void setNetworksTableTabbedPane( NetworksTableTabbedPane networksTableTabbedPane ){ this.networksTableTabbedPane = networksTableTabbedPane; }
	
	private SdnVisualizationViewersTabbedPane sdnVisualizationViewersTabbedPane;
	public SdnVisualizationViewersTabbedPane getSdnNetworksViewersTabbedPane(){ return sdnVisualizationViewersTabbedPane; }
	public void setSdnNetworksVisualizationViewersTabbedPane( SdnVisualizationViewersTabbedPane sdnVisualizationViewersTabbedPane ){ this.sdnVisualizationViewersTabbedPane = sdnVisualizationViewersTabbedPane; }
	
	private VirtualVisualizationViewersTabbedPane virtualVisualizationViewersTabbedPane;
	public VirtualVisualizationViewersTabbedPane getVirtualNetworksVisualizationViewersTabbedPane(){ return virtualVisualizationViewersTabbedPane; }
	public void setVirtualNetworksVisualizationViewersTabbedPane( VirtualVisualizationViewersTabbedPane virtualVisualizationViewersTabbedPane ){ this.virtualVisualizationViewersTabbedPane = virtualVisualizationViewersTabbedPane; }
	
	private JSplitPane splitPane;
	public JSplitPane getSplitPane(){ return splitPane; }
	public void setSplitPane( JSplitPane splitPane ){ this.splitPane = splitPane; }
	
	public NetworksPanel( SimulatorFrame simulatorFrame )
	{	
		this.setNetworksTableTabbedPane( new NetworksTableTabbedPane( simulatorFrame.getSimulator().getSdnNetworks(), simulatorFrame.getSimulator().getVirtualNetworks(), simulatorFrame ) );
		
		this.setSdnNetworksVisualizationViewersTabbedPane( new SdnVisualizationViewersTabbedPane( simulatorFrame ) );
		this.setVirtualNetworksVisualizationViewersTabbedPane( new VirtualVisualizationViewersTabbedPane( simulatorFrame ) );
		
		this.setSplitPane( new JSplitPane() );
		this.getSplitPane().setLeftComponent( this.getNetworksTablesTabbedPane() );
		this.getSplitPane().setRightComponent( this.getSdnNetworksViewersTabbedPane() );
		
		this.setLayout( new BorderLayout() );
		this.add( this.getSplitPane(), BorderLayout.CENTER );
	}
	
}
